package com.sky.mapper;

import com.sky.entity.Dish;
import com.sky.entity.SetmealDish;
import com.sky.vo.DishItemVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 根据菜品id查询套餐id
     * @param dishIds
     * @return
     */
    List<Long> selectSetmealIdByDishId(List<Long> dishIds);

    /**
     * 批量插入套餐和菜品的关系
     * @param list
     */
    void insertBatch(List<SetmealDish> list);

    /**
     * 根据套餐id获取套餐-菜品关系
     * @param setmealId
     * @return
     */
    List<SetmealDish> selectSetmealDishBySetmealId(Long setmealId);

    /**
     * 根据setmealId删除对应的菜品-套餐关系
     * @param ids
     */
    void deleteBySetmealIds(List<Long> ids);

    List<Dish> selectDishesBySetmealId(Long id);

    /**
     * 获取套餐的菜品信息
     * @param setmealId
     * @return
     */
    List<DishItemVO> getSetmealDishes(Long setmealId);
}
